package com.vcc.core.util;

import com.vcc.core.constant.TransactionStatusConstant;
import com.vcc.core.constant.TransactionTypeConstant;

public class TransactionUtil {


    public static String statusHandle(String status) {
        if (TransactionStatusConstant.SUCCESS_LIST.contains(status)) {
            return "SUCCESS";
        } else if (TransactionStatusConstant.PENDING_LIST.contains(status)) {
            return "PENDING";
        } else if (TransactionStatusConstant.FAIL_LIST.contains(status)) {
            return "FAILED";
        } else {
            return status.toUpperCase();
        }
    }

    public static String typeHandle(String type) {
        if (TransactionTypeConstant.AUTH_LIST.contains(type)) {
            return "AUTH";
        } else if (TransactionTypeConstant.VERIFY_LIST.contains(type)) {
            return "VERIFY";
        } else if (TransactionTypeConstant.REFUND_LIST.contains(type)) {
            return "REFUND";
        } else if (TransactionTypeConstant.REVERSAL_LIST.contains(type)) {
            return "REVERSAL";
        } else {
            return type.toUpperCase();
        }
    }


}
